﻿using UnityEngine;
using System.Collections;

public class PlayButton : MonoBehaviour {
	
	public GameObject blackPlane;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnMouseDown () {
		iTween.FadeTo(blackPlane, 1f, 2f);
		StartCoroutine(waitAndLoadLevel());
	}
	
	IEnumerator waitAndLoadLevel()
	{
		yield return new WaitForSeconds(2f);
		Application.LoadLevel("Game");
	}
}
